﻿<html>
<head>
<title>OpenXmlButter : le Sommaire</title>

<script type="text/javascript"  src="js/soapclient.js"></script>



<link rel="stylesheet" type="text/css" href="http://localhost/yui/2.9/build/fonts/fonts-min.css" />
<link rel="stylesheet" type="text/css" href="http://localhost/yui/2.9/build/container/assets/skins/sam/container.css" />
<link type="text/css" rel="stylesheet" href="http://localhost/yui/2.9/build/treeview/assets/skins/sam/treeview.css">
<link rel="stylesheet" type="text/css" href="http://localhost/yui/2.9/build/carousel/assets/skins/sam/carousel.css">


<script type="text/javascript" src="http://localhost/yui/2.9/build/yahoo-dom-event/yahoo-dom-event.js"></script>

<script type="text/javascript" src="http://localhost/yui/2.9/build/dragdrop/dragdrop-min.js"></script>
<script type="text/javascript" src="http://localhost/yui/2.9/build/container/container-min.js"></script>

<script type="text/javascript" src="http://localhost/yui/2.9/build/animation/animation-min.js"></script>


<script type="text/javascript" src="http://localhost/yui/2.9/build/event/event-min.js"></script>
<script type="text/javascript" src="http://localhost/yui/2.9/build/connection/connection-min.js"></script>


<script type="text/javascript" src="http://localhost/yui/2.9/build/get/get-min.js"></script>
<script type="text/javascript" src="http://localhost/yui/2.9/build/datasource/datasource-min.js"></script>
<script type="text/javascript" src="http://localhost/yui/2.9/build/yahoo/yahoo-min.js"></script>
<script type="text/javascript" src="http://localhost/yui/2.9/build/dom/dom-min.js"></script>
<script type="text/javascript" src="http://localhost/yui/2.9/build/element/element-min.js"></script>
<script src="http://localhost/yui/2.9/build/treeview/treeview-min.js" ></script>


<!-- YUI3 -->
<link rel="stylesheet" href="http://yui.yahooapis.com/3.4.0/build/cssreset/cssreset-min.css" type="text/css" charset="utf-8">
<link rel="stylesheet" href="http://yuilibrary.com/yui/docs/assets/scrollview/vertical.css" type="text/css" charset="utf-8">

<script src="http://yui.yahooapis.com/3.4.0/build/yui/yui-min.js"></script>    


<style>
body { padding : 0px ; margin : 0px }
div#upbanner { width : 100%; height : 25px; background-color : black ; color : white ; padding: 5px; font-size: 8pt }

.template
	{
	width : 48px;
	height : 68px ;
	background : url("./file-types-19409.png") no-repeat;
	background-position : 0px -272px ;
	display : bloc ;
	}

.li-doc 
	{	
	height : 70px ;	
	font-size : 10pt ;	
    border-bottom: 1px solid #ccc;
    padding: 8px;    
    font-weight: bold;
    
	}


   /* Avoid resource latency for these, since they hide unenhanced content */
            .yui3-js-enabled .yui3-scrollview-loading {
                visibility:hidden;
            }

            #additional-content {
                display:none;
            }

</style>

<script>
var url = "http://localhost:8080/service/webservice1.asmx";

var pnlDocTemplates;
var treeDocTemplates ;

function init()
{
	// Instantiate a Panel from markup
	pnlDocTemplates = new YAHOO.widget.Panel("pnlDocTemplates", { width:"200px", visible:true, constraintoviewport:true } );
	pnlDocTemplates.render();
	
	
	refreshDocTemplates();
}

//mettre à jour la liste des modèles document
function refreshDocTemplates()
{

var sUrl = url + "/getDocumentTemplates" ;


//ouvrir une requete
var dsLocalArray = new YAHOO.util.XHRDataSource( sUrl );
dsLocalArray.responseType = YAHOO.util.XHRDataSource.TYPE_XML;
dsLocalArray.responseSchema = 
	{    
    resultNode: "DocumentTemplate",
    fields: [ { key:"Code"}, {key:"Description"}   ]
	};

//gestion de la réponse
dsLocalArray.sendRequest( 
	null , 
	{ success : function (req,res) 
		{
			var data = res.results ;
			fillDocTemplatesTree( data );
		}  
	} 
);

}

//gérer l'affichage à partir des données
function fillDocTemplatesTree( data )
{

//créer l'arbre
//var treeDocTemplates = new YAHOO.widget.TreeView("treeDocTemplates");
//var root = treeDocTemplates.getRoot();

var html = "";


for (i=0;i<data.length;i++)
{
	//var tmpNode = new YAHOO.widget.TextNode( data[i].Description, root, false);
	html += "<li class='li-doc'><span class='template'>&nbsp;</span>" + data[i].Description + "</li>" ;
	
}

document.getElementById("scroll-content").innerHTML = html ;

//treeDocTemplates.render();

    YUI().use('scrollview-base', function(Y) {

        var scrollView = new Y.ScrollView({
            id:"scrollview",
            srcNode: '#scrollview-content',
            height: 100,           	
            flick: {
                minDistance:10,
                minVelocity:0.3,
                axis: "y"
            }
        });

        scrollView.render();
    });

}


YAHOO.util.Event.addListener(window, "load", init);

</script>

</head>
<body class="yui-skin-sam">
<div id="upbanner">Bonjour, Cyril Stouck</div>

<div id="pnlDocTemplates">
	<div class="hd">Modèles de document</div>
	<div class="bd">
		<!--<div id="treeDocTemplates"></div>-->

		
		
	</div>
</div>

		<!-- scrollview -->
		<div id="scrollview-container">
			<div id="scrollview-header">
				<h1>Modèles de documents</h1>
			</div>
			<div id="scrollview-content" class="yui3-scrollview-loading">
				<ul id="scroll-content">        
				</ul>
			</div>    
		</div>


</body>
</html>